package com.yyt.libsrc.helper;

import com.yyt.libsrc.conf.Consts;

import top.lixb.libcommon.utils.SPUtils;

public class LocalHelper {

    public static String getSTicket() {
        return SPUtils.getString(Consts.KEY.S_TICKET, "");
    }

    public static void saveSTicket(String sticket) {
        SPUtils.putString(Consts.KEY.S_TICKET,sticket);
    }

    public static boolean getPushmsgSpeakEnable() {
        return SPUtils.getBoolean(Consts.KEY.pushmsg_speak_enable, true);
    }

    public static void savePushmsgSpeakEnable(boolean enable) {
        SPUtils.putBoolean(Consts.KEY.pushmsg_speak_enable,enable);
    }

    public static String getTicket() {
        return SPUtils.getString(Consts.KEY.TICKET, "");
    }
    public static void saveTicket(String ticket) {
        SPUtils.putString(Consts.KEY.TICKET,ticket);
    }

    public static void saveLoginTime(long l) {
        SPUtils.putLong(Consts.KEY.TIME_LOGIN,l);
    }

    public static long getLoginTime() {
        return SPUtils.getLong(Consts.KEY.TIME_LOGIN, 0);
    }

    public static String getMemberType() {
        return SPUtils.getString(Consts.KEY.MEMBER_TYPE, "");
    }

    public static void saveMemberType(String memberType) {
        SPUtils.putString(Consts.KEY.MEMBER_TYPE,memberType);
    }

    public static void saveLoginBean(String response) {
        SPUtils.putString(Consts.KEY.LOGIN_BEAN, response);
    }

    public static String getLoginBean() {
        return SPUtils.getString(Consts.KEY.LOGIN_BEAN, "");
    }

    public static String getSid() {
        return SPUtils.getString(Consts.KEY.USER_SID,"");
    }

    public static void saveSid(String sid) {
        SPUtils.putString(Consts.KEY.USER_SID, sid);
    }

    public static String getHeadIconUrl() {
        return SPUtils.getString(Consts.KEY.HEAD_ICON,"");
    }

    public static void saveHeadIconUrl(String url) {
        SPUtils.putString(Consts.KEY.HEAD_ICON,url);
    }

    public static void saveUserName(String name) {
        SPUtils.putString(Consts.KEY.USER_NAME,name);
    }

    public static String getUserName() {
        return SPUtils.getString(Consts.KEY.USER_NAME, "");
    }

    public static int getMyRole() {
        return SPUtils.getInt(Consts.KEY.MY_ROLE, 1);
    }

    public static void saveMyrole(int role) {
        SPUtils.putInt(Consts.KEY.MY_ROLE,role);
    }

    public static void saveMyrate(String myrate) {
        SPUtils.putString(Consts.KEY.MY_RATE,myrate);
    }
    public static String getMyrate() {
        return SPUtils.getString(Consts.KEY.MY_RATE, "0.01");
    }
}
